package org.hgg.workflow.admin.model;


import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @author Jarvis
 */
public class Task implements Serializable {
    /**
     * 任务id
     */
    private Integer taskId;

    /**
     * 工作流id
     */
    private Integer workflowId;

    /**
     * 任务名称
     */
    private String taskName;

    /**
     * 任务状态
     */
    private Integer taskStatus;

    /**
     * 任务结果
     */
    private String result;

    /**
     * 上游任务id，多个逗号隔开
     */
    private String taskParents;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    /**
     * 任务id
     */
    public Integer getTaskId() {
        return taskId;
    }

    /**
     * 任务id
     */
    public void setTaskId(Integer taskId) {
        this.taskId = taskId;
    }

    /**
     * 工作流id
     */
    public Integer getWorkflowId() {
        return workflowId;
    }

    /**
     * 工作流id
     */
    public void setWorkflowId(Integer workflowId) {
        this.workflowId = workflowId;
    }

    /**
     * 任务名称
     */
    public String getTaskName() {
        return taskName;
    }

    /**
     * 任务名称
     */
    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    /**
     * 任务状态
     */
    public Integer getTaskStatus() {
        return taskStatus;
    }

    /**
     * 任务状态
     */
    public void setTaskStatus(Integer taskStatus) {
        this.taskStatus = taskStatus;
    }

    /**
     * 任务结果
     */
    public String getResult() {
        return result;
    }

    /**
     * 任务结果
     */
    public void setResult(String result) {
        this.result = result;
    }

    /**
     * 上游任务id，多个逗号隔开
     */
    public String getTaskParents() {
        return taskParents;
    }

    /**
     * 上游任务id，多个逗号隔开
     */
    public void setTaskParents(String taskParents) {
        this.taskParents = taskParents;
    }

    /**
     * 创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 更新时间
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 更新时间
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Task other = (Task) that;
        return (this.getTaskId() == null ? other.getTaskId() == null : this.getTaskId().equals(other.getTaskId()))
            && (this.getWorkflowId() == null ? other.getWorkflowId() == null : this.getWorkflowId().equals(other.getWorkflowId()))
            && (this.getTaskName() == null ? other.getTaskName() == null : this.getTaskName().equals(other.getTaskName()))
            && (this.getTaskStatus() == null ? other.getTaskStatus() == null : this.getTaskStatus().equals(other.getTaskStatus()))
            && (this.getResult() == null ? other.getResult() == null : this.getResult().equals(other.getResult()))
            && (this.getTaskParents() == null ? other.getTaskParents() == null : this.getTaskParents().equals(other.getTaskParents()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTaskId() == null) ? 0 : getTaskId().hashCode());
        result = prime * result + ((getWorkflowId() == null) ? 0 : getWorkflowId().hashCode());
        result = prime * result + ((getTaskName() == null) ? 0 : getTaskName().hashCode());
        result = prime * result + ((getTaskStatus() == null) ? 0 : getTaskStatus().hashCode());
        result = prime * result + ((getResult() == null) ? 0 : getResult().hashCode());
        result = prime * result + ((getTaskParents() == null) ? 0 : getTaskParents().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", taskId=").append(taskId);
        sb.append(", workflowId=").append(workflowId);
        sb.append(", taskName=").append(taskName);
        sb.append(", taskStatus=").append(taskStatus);
        sb.append(", result=").append(result);
        sb.append(", taskParents=").append(taskParents);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}